﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Surface.Core;
using Microsoft.Surface.Core.Manipulations;
using Microsoft.Xna.Framework;

namespace Sublimation
{
    class Tower_Surf :Tower {
        protected Tower_manipulator tower_manipulator;

        public Tower_Surf(Game game, Player owner, Vector2 position, WorldProperties_Surf worldProperties)
            : base(game, owner, position, worldProperties)
        {  
            tower_manipulator = new Tower_manipulator(position);
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            tower_manipulator.update(((WorldProperties_Surf)worldProperties).Contacts);
            rotation = tower_manipulator.ManipulationRotation;
        }

        public void add_contact(Contact contact)
        {
            tower_manipulator.add_contact(contact);
        }


        public bool belongs(Contact contact)
        {
            if ((contact.X - position.X) * (contact.X - position.X) + (contact.Y - position.Y) * (contact.Y - position.Y) < RADIUS * RADIUS)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
